import React from 'react';
import { connect } from 'react-redux';
import actions from '@/store/actions/counter';

function Counter(props) {
    const { count, add, async_add, minus } = props;
    return <>
        <h2>{count}</h2>
        <button onClick={add}>+</button>
        <button onClick={async_add}>async_add +</button>
        <button onClick={minus}>-</button>
    </>
}

const mapStateToProps = (state) => state.counter;

export default connect(mapStateToProps, actions)(Counter)